//
//  NSString+ContentVerify.h
//  SPKit
//
//  Created by 李双鹏 on 15/10/5.
//  Copyright (c) 2015年 SP. All rights reserved.
//

#import <Foundation/Foundation.h>

#if TARGET_OS_IPHONE
    #ifndef __IPHONE_8_0
    #define __IPHONE_8_0 80000

    #if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_8_0
        #define NEED_ADD_NEW_API 1
    #else
        #define NEED_ADD_NEW_API 0
    #endif
    #endif
#elif TARGET_OS_MAC
    #ifndef __MAC_10_10
    #define __MAC_10_10         101000
    #endif

    #if __MAC_OS_X_VERSION_MAX_ALLOWED < __MAC_10_10
        #define NEED_ADD_NEW_API 1
    #else
        #define NEED_ADD_NEW_API 0
    #endif
#endif

@interface NSString (ContentVerify)

/// 验证手机号
-(BOOL)isValidPhoneNumber;
/// 验证身份证
-(BOOL)isValidIDCard;

/// remove white spaces from String
- (NSString *)removeWhiteSpaces;

/// Checking if String is Empty
-(BOOL)isBlank;

/// Counts number of Words in String
- (NSUInteger)countNumberOfWords;

/// If my string starts with given string
- (BOOL)isBeginsWith:(NSString *)string;

/// If my string ends with given string
- (BOOL)isEndsWith:(NSString *)string;

/// Replace particular characters in my string with new character
- (NSString *)replaceString:(NSString *)oldString withString:(NSString *)newString;

/// Remove particular sub string from main string
-(NSString *)removeSubString:(NSString *)subString;

/// If my string contains ony letters
- (BOOL)isContainsOnlyLetters;

/// If my string contains only numbers
- (BOOL)isContainsOnlyNumbers;

/// If my string contains letters and numbers
- (BOOL)isContainsOnlyNumbersAndLetters;

/// If my string is available in particular array
- (BOOL)isContainedInArray:(NSArray*)array;


/**
 * Override the primary interface function,to ensure this meethod is usale in iOS version less then iOS 8.0.
 */
- (BOOL)containsString:(NSString *)subString;

@end
